Conversation
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added an HTML visual response mode for chat.
This change adds a persisted chat input toggle using the Blocks animated icon. When enabled, chat requests send
htmlVisualPrompt, and the backend injects a request-level system instruction without modifying the visible user message or stored conversation content. The injected prompt supports Chinese and English variants based on the current user message language.It also improves inline HTML rendering for Markdown responses with a constrained allowlist and style sanitizer, so safe inline visual layouts can render inside normal chat content while blocking high-risk HTML/CSS patterns.
Change type
Affected areas
Verification
cd frontend && pnpm lintcd frontend && pnpm buildcd backend && go test ./internal/application/conversation ./internal/transport/http/conversationcd backend && go test ./...cd backend && make swaggergit diff --checkScreenshots, API examples, or logs
Chat request payload now supports:
{ "contentType": "text", "content": "解释一下大气循环", "model": "example-model", "htmlVisualPrompt": true }Configuration, migration, and compatibility notes
API changes:
SendMessageRequestadds optionalhtmlVisualPrompt.Generated Swagger was updated.
Database migrations: None.
Deployment changes: None.
Backward compatibility: Existing clients remain compatible because the new request field is optional and defaults to disabled.
Documentation
Security and privacy
Checklist
.pycfiles,.envfiles, and local storage data are not committed.